home *** CD-ROM | disk | FTP | other *** search
- /* UDP-related user commands */
- #include <stdio.h>
- #include "global.h"
- #include "mbuf.h"
- #include "netuser.h"
- #include "udp.h"
- #include "internet.h"
- #include "cmdparse.h"
-
- extern struct udp_stat Udp_stat;
- char *pinet();
- int doudpstat();
-
- struct cmds Udpcmds[] = {
- "status", doudpstat, 0, 0, NULLCHAR,
- NULLCHAR, NULLFP, 0, 0,"udp subcommands: status",
- };
-
- doudp(argc,argv)
- int argc;
- char *argv[];
- {
- return subcmd(Udpcmds,argc,argv);
- }
- /* Dump UDP statistics and control blocks */
- doudpstat()
- {
- register struct udp_cb *udp;
- register int i;
-
- printf("sent %u rcvd %u bdcsts %u cksum err %u unknown socket %u\n",
- Udp_stat.sent,Udp_stat.rcvd,Udp_stat.bdcsts,Udp_stat.cksum,Udp_stat.unknown);
- printf(" &UCB Rcv-Q Local socket\n");
- for(i=0;i<NUDP;i++){
- for(udp = Udps[i];udp != NULLUDP; udp = udp->next){
- st_udp(udp,1);
- }
- }
- }
- st_udp(udp,n)
- struct udp_cb *udp;
- int n;
- {
- if(n == 0)
- printf(" &UCB Rcv-Q Local socket\n");
-
- printf("%8lx%6u %s\n",ptol(udp),udp->rcvcnt,
- pinet(&udp->socket));
-
- }
-